using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Week1.player
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class MousePointer : world.Draw2DBase
    {
        protected player.Camera oCamera;

        public MousePointer(Game game, string textureName, player.Camera camera)
            : base(game, 1, textureName)
        {
            oCamera = camera;
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {

            base.Initialize();
        }

        protected override void LoadContent()
        {
            base.LoadContent();
        }

        int mouseX;
        int mouseY;
        MouseState mouseState;
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            mouseState = Mouse.GetState();
            mouseX = mouseState.X;

            mouseY = mouseState.Y;

            if (mouseX < 0)
                mouseX = 0;
            if (mouseX > 1014)
                mouseX = 1014;
            if (mouseY < 0)
                mouseY = 0;
            if (mouseY > 590)
                mouseY = 590;

            setSpriteLocation(0, mouseX, mouseY, 50, 50);

            
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {

            base.Draw(gameTime);
        }
    }
}
